package com.example.demoshardingjdbc;

import io.shardingsphere.core.keygen.DefaultKeyGenerator;
import io.shardingsphere.core.keygen.KeyGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.jdbc.datasource.embedded.DataSourceFactory;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import javax.sql.DataSource;

@SpringBootApplication
@EnableTransactionManagement
public class DemoShardingjdbcApplication {

    public static void main(String[] args) {
        SpringApplication.run(DemoShardingjdbcApplication.class, args);
    }

    @Bean
    public KeyGenerator keyGenerator(){
        return new DefaultKeyGenerator();
    }
}
